# encoding: utf-8
__author__ = 'zhengyong'

import random
import os
import time
import datetime
from os.path import join
import sys
from openpyxl import Workbook, load_workbook
from contextlib import closing
import openpyxl
from openpyxl.styles import colors
from openpyxl.styles import Font, Color
from openpyxl.styles import colors
from openpyxl import Workbook
import subprocess


class CreateData():
    ROBOT_LIBRARY_SCOPE = 'GLOBAL'
    ROBOT_LIBRARY_VERSION = 0.1

    def __init__(self):
        pass

    def change_createtime(self,createtime):
        # "createtime": "2018-06-18 9:15:24",
        #createtime = "2018-06-18 9:15:24"
        tmptime = str(createtime[:-2])
        # #tmptime = str(createtime[-5:-3])
        # print(str(createtime[0:13]))
        num = random.randrange(0,59)
        if num<10:
            num = "0"+str(num)
        else:
            num = str(num)
        new_createtime= tmptime + num
        return new_createtime

    # 生成中文姓名：
    # value通过robot framework传递为'1'时，生成标准中文名
    # value为'fore_space'时，生成姓名前有空格，
    # value为'back_space'时，生成姓名后有空格，
    # value为'mid_space'时，生成姓名后有空格。
    def get_chinese_name(self, value):

        last_name_str = '赵钱孙李周吴郑王冯陈楮卫蒋沈韩杨朱秦尤许何吕施张孔曹严华金魏陶姜戚谢邹喻柏水窦章云苏潘葛奚' \
                        '范彭郎鲁韦昌马苗凤花方俞任袁柳酆鲍史唐费廉岑薛雷贺倪汤滕殷罗毕郝邬安常乐于时傅皮卞齐康伍余' \
                        '元卜顾孟平黄和穆萧尹姚邵湛汪祁毛禹狄米贝明臧计伏成戴谈宋茅庞熊纪舒屈项祝董梁杜阮蓝闽级席季' \
                        '麻强贾路娄危江童颜郭梅盛林刁锺徐丘骆高夏蔡田樊胡凌霍虞万支柯昝管卢莫经房裘缪干解应宗丁宣贲' \
                        '邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊於惠甄麹家封芮羿储靳汲邴糜松井段富巫乌焦巴弓' \
                        '牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁仇栾暴甘斜厉戎祖武符刘景詹束龙叶幸司韶郜黎蓟薄印宿白怀蒲' \
                        '邰从鄂索咸籍赖卓蔺屠蒙池乔阴郁胥能苍双闻莘党翟谭贡劳逄姬申扶堵冉宰郦雍郤璩桑桂濮牛寿通边扈' \
                        '燕冀郏浦尚农温别庄晏柴瞿阎充慕连茹习宦艾鱼容向古易慎戈廖庾终暨居衡步都耿满弘匡国文寇广禄阙' \
                        '东欧殳沃利蔚越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相查后荆红游竺权逑' \
                        '盖益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇甫尉迟公羊澹台公冶宗政濮阳淳于单于太叔申屠公' \
                        '孙仲孙轩辕令狐锺离宇文长孙慕容鲜于闾丘司徒司空丌官司寇仉督子车颛孙端木巫马公西漆雕乐正壤驷' \
                        '邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊於惠甄麹家封芮羿储靳汲邴糜松井段富巫乌焦巴弓' \
                        '牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁仇栾暴甘斜厉戎祖武符刘景詹束龙叶幸司韶郜黎蓟薄印宿白怀蒲' \
                        '邰从鄂索咸籍赖卓蔺屠蒙池乔阴郁胥能苍双闻莘党翟谭贡劳逄姬申扶堵冉宰郦雍郤璩桑桂濮牛寿通边扈' \
                        '燕冀郏浦尚农温别庄晏柴瞿阎充慕连茹习宦艾鱼容向古易慎戈廖庾终暨居衡步都耿满弘匡国文寇广禄阙' \
                        '东欧殳沃利蔚越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相查后荆红游竺权逑' \
                        '邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊於惠甄麹家封芮羿储靳汲邴糜松井段富巫乌焦巴弓' \
                        '牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁仇栾暴甘斜厉戎祖武符刘景詹束龙叶幸司韶郜黎蓟薄印宿白怀蒲' \
                        '邰从鄂索咸籍赖卓蔺屠蒙池乔阴郁胥能苍双闻莘党翟谭贡劳逄姬申扶堵冉宰郦雍郤璩桑桂濮牛寿通边扈' \
                        '燕冀郏浦尚农温别庄晏柴瞿阎充慕连茹习宦艾鱼容向古易慎戈廖庾终暨居衡步都耿满弘匡国文寇广禄阙' \
                        '东欧殳沃利蔚越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相查后荆红游竺权逑' \
                        '盖益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇甫尉迟公羊澹台公冶宗政濮阳淳于单于太叔申屠公' \
                        '盖益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇甫尉迟公羊澹台公冶宗政濮阳淳于单于太叔申屠公' \
                        '公良拓拔夹谷宰父谷梁晋楚阎法汝鄢涂钦段干百里东郭南门呼延归海羊舌微生岳帅缑亢况后有琴梁丘左' \
                        '丘东门西门商牟佘佴伯赏南宫墨哈谯笪年爱阳佟'

        first_name_str = '婷倩睿瑜嘉君盈男萱雨乐欣悦雯晨珺月雪秀晓然冰新淑玟萌凝文展露静智丹宁颖平佳玲彤芸莉璐云聆芝' \
                         '娟超香英菲涓洁萍蓉潞笑迪敏靓菁慧涵韵琳燕依妙美宜尚诗钰娜仪娇谊语彩清好睻曼蔓茜沁韶舒盛越琪' \
                         '邓郁单杭洪包诸左石崔吉钮龚程嵇邢滑裴陆荣翁荀羊於惠甄麹家封芮羿储靳汲邴糜松井段富巫乌焦巴弓' \
                         '牧隗山谷车侯宓蓬全郗班仰秋仲伊宫宁仇栾暴甘斜厉戎祖武符刘景詹束龙叶幸司韶郜黎蓟薄印宿白怀蒲' \
                         '邰从鄂索咸籍赖卓蔺屠蒙池乔阴郁胥能苍双闻莘党翟谭贡劳逄姬申扶堵冉宰郦雍郤璩桑桂濮牛寿通边扈' \
                         '燕冀郏浦尚农温别庄晏柴瞿阎充慕连茹习宦艾鱼容向古易慎戈廖庾终暨居衡步都耿满弘匡国文寇广禄阙' \
                         '东欧殳沃利蔚越夔隆师巩厍聂晁勾敖融冷訾辛阚那简饶空曾毋沙乜养鞠须丰巢关蒯相查后荆红游竺权逑' \
                         '盖益桓公万俟司马上官欧阳夏侯诸葛闻人东方赫连皇甫尉迟公羊澹台公冶宗政濮阳淳于单于太叔申屠公' \
                         '霞艺函迎虹爽瑞珏桐筱苹莹名晗甜晴亭吉玉晶妍凤蒙霖希宣昕丽心可旻阳真蓝畅荣岚乔育芷姿妹姗瑾奕' \
                         '兰航蕾艳怡青珊才小子允加巧冉北朵多羽如帆伶采西贝其春易咏亚明秋泓伦朔哲益轩容玹津启婧晟婉常' \
                         '浩景茗尧雅杰媛诒翔为捷钧毓意琸靖渺渲熙微祺梦赫菡纶铭齐华菏毅瑶品梓国卿振卫叶亿娆漫兴蓓融嫒' \
                         '锦翰科润霏灿忆聪怿蕊谨丰丛璇议馨瀚潇莺珑俪骄骁灵忻昭金昊志辰宇安凡禾竹愉丫珂洺苒若偌珮棋淇' \
                         '群会维影逸娴赏霄辉莲优瑷朦涛识誉巍鑫逦湾中予卉永同州任宏卓晨轩清睿宝涛华国亮新凯志明伟嘉东' \
                         '洪建文子云杰兴友才振辰航达鹏宇衡佳强宁丰波森学民永翔鸿海飞义生凡连良乐勇辉龙川宏谦锋双霆玉' \
                         '智增名进德聚军兵忠廷先江昌政君泽超信腾恒礼元磊阳月士洋欣升恩迅科富函业胜震福瀚瑞朔津韵荣为' \
                         '诚斌广庆成峰可健英功冬锦立正禾平旭同全豪源安顺帆向雄材利希风林奇易来咏岩启坤昊朋和纪艺昭映' \
                         '威奎帅星春营章高伦庭蔚益城牧钊刚洲家晗迎罡浩景珂策皓栋起棠登越盛语钧亿基理采备纶献维瑜齐凤' \
                         '霞艺函迎虹爽瑞珏桐筱苹莹名晗甜晴亭吉玉晶妍凤蒙霖希宣昕丽心可旻阳真蓝畅荣岚乔育芷姿妹姗瑾奕' \
                         '兰航蕾艳怡青珊才小子允加巧冉北朵多羽如帆伶采西贝其春易咏亚明秋泓伦朔哲益轩容玹津启婧晟婉常' \
                         '浩景茗尧雅杰媛诒翔为捷钧毓意琸靖渺渲熙微祺梦赫菡纶铭齐华菏毅瑶品梓国卿振卫叶亿娆漫兴蓓融嫒' \
                         '锦翰科润霏灿忆聪怿蕊谨丰丛璇议馨瀚潇莺珑俪骄骁灵忻昭金昊志辰宇安凡禾竹愉丫珂洺苒若偌珮棋淇' \
                         '群会维影逸娴赏霄辉莲优瑷朦涛识誉巍鑫逦湾中予卉永同州任宏卓晨轩清睿宝涛华国亮新凯志明伟嘉东' \
                         '洪建文子云杰兴友才振辰航达鹏宇衡佳强宁丰波森学民永翔鸿海飞义生凡连良乐勇辉龙川宏谦锋双霆玉' \
                         '智增名进德聚军兵忠廷先江昌政君泽超信腾恒礼元磊阳月士洋欣升恩迅科富函业胜震福瀚瑞朔津韵荣为' \
                         '诚斌广庆成峰可健英功冬锦立正禾平旭同全豪源安顺帆向雄材利希风林奇易来咏岩启坤昊朋和纪艺昭映' \
                         '霞艺函迎虹爽瑞珏桐筱苹莹名晗甜晴亭吉玉晶妍凤蒙霖希宣昕丽心可旻阳真蓝畅荣岚乔育芷姿妹姗瑾奕' \
                         '兰航蕾艳怡青珊才小子允加巧冉北朵多羽如帆伶采西贝其春易咏亚明秋泓伦朔哲益轩容玹津启婧晟婉常' \
                         '浩景茗尧雅杰媛诒翔为捷钧毓意琸靖渺渲熙微祺梦赫菡纶铭齐华菏毅瑶品梓国卿振卫叶亿娆漫兴蓓融嫒' \
                         '锦翰科润霏灿忆聪怿蕊谨丰丛璇议馨瀚潇莺珑俪骄骁灵忻昭金昊志辰宇安凡禾竹愉丫珂洺苒若偌珮棋淇' \
                         '群会维影逸娴赏霄辉莲优瑷朦涛识誉巍鑫逦湾中予卉永同州任宏卓晨轩清睿宝涛华国亮新凯志明伟嘉东' \
                         '洪建文子云杰兴友才振辰航达鹏宇衡佳强宁丰波森学民永翔鸿海飞义生凡连良乐勇辉龙川宏谦锋双霆玉' \
                         '智增名进德聚军兵忠廷先江昌政君泽超信腾恒礼元磊阳月士洋欣升恩迅科富函业胜震福瀚瑞朔津韵荣为' \
                         '诚斌广庆成峰可健英功冬锦立正禾平旭同全豪源安顺帆向雄材利希风林奇易来咏岩启坤昊朋和纪艺昭映' \
                         '毅谊贤逸卫万臻儒钢洁霖隆远聪耀誉继珑哲岚舜钦琛金彰亭泓蒙祥意鑫朗晟晓晔融谋宪励璟骏颜焘垒尚' \
                         '镇济雨蕾韬选议曦奕彦虹宣蓝冠谱泰泊跃韦怡骁俊沣骅歌畅与圣铭溓滔溪巩影锐展笑祖时略敖堂崊绍崇' \
                         '悦邦望尧珺然涵博淼琪群驰照传诗靖会力大山之中方仁世梓竹至充亦丞州言佚序宜'
        last_name = last_name_str[random.randint(0, len(last_name_str) - 1)]
        mid_name = first_name_str[random.randint(0, len(first_name_str) - 1)]
        first_name = first_name_str[random.randint(0, len(first_name_str) - 1)]
        if str(value) == 'fore_space':
            return ' ' + last_name + first_name
        elif str(value) == 'back_space':
            return last_name + first_name + ' '
        elif str(value) == 'mid_space':
            return last_name + ' ' + first_name
        elif str(value) == 'mid_point':
            return last_name + '·' + first_name
        elif str(value) == 'low_point':
            return last_name + '.' + first_name
        else:
            return last_name + mid_name + first_name

    # 生成英文姓名
    def get_english_name(self):
        first_letter = 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
        e_name1 = random.choice(first_letter)
        e_name2 = ''.join(random.sample(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
                                       'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
                                       'z'], 6)).replace(" ", "")
        return e_name1 + e_name2

    # 生成数字姓名
    def get_number_name(self):
        num_name = ''.join(random.sample(['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'], 6)).replace(" ", "")
        return num_name

    # 生成汉字、空格、数字、中点、字母、下点混合的姓名
    def get_mix_name(self):
        name1 = ''.join(random.sample(['赵', '钱', '孙', '李', '周', '吴', '郑', '王'], 1)).replace(" ", "")
        name2 = ''.join(random.sample(['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'], 6)).replace(" ", "")
        name3 = ''.join(random.sample(['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n',
                                       'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y',
                                       'z'], 3)).replace(" ", "")
        name4 = ''.join(random.sample(['洪', '建', '文', '子', '云', '杰', '兴', '友'], 1)).replace(" ", "")
        return name1 + ' ' + name2 + '·' + name3 + '.' + name4

    # 生成指定位数的手机号
    def get_phone(self, num):
        phone_number_list = [133, 153, 180, 181, 189, 130, 131, 132, 145, 155, 156, 185, 186, 134, 135, 136, 137,
                             138, 139, 147, 150, 151, 152, 157, 158, 159, 182, 183, 184, 187, 188]
        count = int(num) - 3
        phone_number = ''
        eight_number_count = 0
        phone_three_start_number = phone_number_list[random.randint(0, len(phone_number_list) - 1)]
        phone_number += str(phone_three_start_number)
        while eight_number_count < count:
            phone_number += str(random.randint(0, 9))
            eight_number_count += 1
            pass
        return phone_number

    # 生成头两位非法的手机号
    def get_unnormal_phone(self):
        phone_number_list1 = random.choice([2, 3, 4, 5, 6, 7, 8, 9])
        phone_number_list2 = random.choice([1, 2, 6, 9])
        phone_number_list3 = random.choice([1, 2, 3, 4, 5, 6, 7, 8, 9])

        phone_number = ''
        eight_number_count = 0
        phone_three_start_number = str(phone_number_list1) + str(phone_number_list2) + str(phone_number_list3)
        phone_number += str(phone_three_start_number)
        while eight_number_count < 8:
            phone_number += str(random.randint(0, 9))
            eight_number_count += 1
            pass
        return phone_number

    # 生成标准邮箱
    def get_normal_email(self, mail_addr, mail_posi):
        m = 10
        seedstr = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
        sa = []
        for i in range(1, int(m)):
            sa.append(random.choice(seedstr))
        salt1 = ''.join(sa)
        eMail = salt1+"@"+str(mail_addr)+"."+str(mail_posi)
        return eMail

    # 生成只有名称和@的非法邮箱
    def get_unnormal_name_only_email(self):
        m = 10
        seedstr = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
        sa = []
        for i in range(1, int(m)):
            sa.append(random.choice(seedstr))
        salt1 = ''.join(sa)
        eMail = salt1+"@"
        return eMail

    # 生成只有@的非法邮箱
    def get_unnormal_mark_only_email(self):

        return '@'

    # 当num等于18时，根据指定年龄区间，随机生成18位的身份证号
    # 当num大于18时，随机生成num指定位数的非法身份证号
    # 当num小于18时，随机生成num指定位数的非法身份证号
    def get_eighteen_certId(self, ageStart, ageEnd, num):
        ARR = (7, 9, 10, 5, 8, 4, 2, 1, 6, 3, 7, 9, 10, 5, 8, 4, 2)
        LAST = ('1', '0', 'X', '9', '8', '7', '6', '5', '4', '3', '2')

        t = time.localtime()[0]
        x = '%02d%02d%02d%04d%02d%02d%03d' % (random.randint(10, 99),
                                            random.randint(0o1, 99),
                                            random.randint(0o1, 99),
                                            random.randint(t - int(ageEnd), t - int(ageStart)),
                                            random.randint(1, 12),
                                            random.randint(1, 28),
                                            random.randint(1, 999))
        y = 0
        for i in range(17):
            y += int(x[i]) * ARR[i]

        certId = '%s%s' % (x, LAST[y % 11])

        if int(num) == 18:
            return certId
        elif int(num) > 18:
            number = ''.join(random.sample(['1', '2', '3', '4', '5', '6', '7', '8', '9', '0'], int(num) - 18)).replace(" ", "")
            return certId + number
        else:
            return certId[:int(num)]

    # 根据指定年龄区间，随机生成15位的身份证号
    def get_fifteen_certId(self, ageStart, ageEnd):

        t = int(time.strftime("%y", time.localtime()))
        x = '%02d%02d%02d%02d%02d%02d%03d' % (random.randint(10, 99),
                                            random.randint(0o1, 99),
                                            random.randint(0o1, 99),
                                            abs(random.randint(t - int(ageEnd), t - int(ageStart))),
                                            random.randint(1, 12),
                                            random.randint(1, 28),
                                            random.randint(1, 999))

        return x

    # 生成负数
    def get_negative_number(self):

        return -1

    # 根据指定的起止数区间，随机生成指定位数的小数
    def get_float_number(self, start_num, end_num, round_num):

        return round(random.uniform(int(start_num), int(end_num)), int(round_num))

    # 根据指定的起止数区间，随机生成整数
    def get_int_number(self, start_num, end_num):

        return random.randint(int(start_num), int(end_num))

    # 根据指定的起止数区间，随机生成字符串
    def get_random_string(self):
        m = 10
        sa = []
        seedstr = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
        for i in range(1, int(m)):
            sa.append(random.choice(seedstr))
        return ''.join(sa)

    # 随机选择学历
    def get_degree_choice(self):
        seed = ["B0301","B0302","B0303","B0304","B0305","B0306","B0307"]
        degree = random.choice(seed)
        return degree

    # 当input_info为'0000'时，随机选择证件类型
    # 当input_info为'B1301'时，返回输入的'B1301'
    def get_certType_choice(self, input_info):
        if input_info == '0000':
            seed = ["B1300","B1301","B1302","B1303","B1304","B1305","B1306","B1307","B1308","B1309","B1310","B1311","B1312","B1399"]
            certType = random.choice(seed)
        else:
            certType = input_info
        return certType

    # 当input_num为'0000'时，随机选择风险评级
    # 当input_num为'A'时，返回输入的'A'
    def get_riskGrade_choice(self, input_num):
        if input_num == '0000':
            list = ['A', 'B', 'C', 'D', 'E', 'AA', 'BB']
            riskGrade = random.choice(list)
        else:
            riskGrade = input_num
        return riskGrade

    # 当input_values为'0000',随机选择career
    # 当input_values为指定值时，随机选择除指定值的career
    def get_career_choice(self, input_values):
        seed = ["F12301", "F1230101", "F123010101", "F123010102", "F123010103", "F1230102", "F123010201", "F123010202", "F12302", "F1230201", "F123020101", "F123020102", "F123020103", "F1230202", "F123020201", "F123020202", "F123020203", "F12303", "F1230301", "F123030101", "F12304", "F1230401", "F123040101", "F1230402", "F123040201", "F1230403", "F123040301", "F123040302", "F12305", "F1230501", "F123050101", "F123050102", "F12306", "F1230601", "F123060101", "F123060102", "F123060103", "F1230602", "F123060201", "F123060202", "F123060203", "F123060204", "F1230603", "F123060301", "F1230604", "F123060401", "F123060402", "F123060403", "F123060404", "F12307","F1230701", "F123070101", "F123070102", "F123070103", "F1230702","F123070201", "F123070202", "F123070203", "F1230703", "F123070301", "F123070302", "F12308", "F1230801","F123080101","F123080102", "F123080103", "F123080104", "F1230802","F123080201", "F123080202", "F1230803", "F123080301","F1230804", "F123080401", "F123080402", "F1230805","F123080501","F12309", "F1230901", "F123090101","F1230902","F123090201", "F123090202", "F1230903", "F123090301","F123090302","F1230904", "F123090401", "F123090402","F1230905", "F123090501", "F1230906", "F123090601", "F1230907","F123090701","F123090702", "F1230908", "F123090801", "F123090802", "F123090803", "F1230909","F123090901","F123090902","F1230910","F123091001", "F123091002", "F123091003", "F1230911", "F123091101", "F123091102","F1230912","F123091201","F123091202", "F123091203", "F1230913", "F123091301", "F123091302", "F12310","F1231001","F123100101","F123100102","F1231002", "F123100201", "F123100202", "F1231003", "F123100301", "F123100302","F12311","F1231101","F123110101","F123110102", "F123110103", "F123110104", "F1231102", "F123110201", "F123110202","F12312","F1231201","F123120101","F123120102", "F123120103", "F123120104", "F1231202", "F123120201","F1231203","F123120301","F123120302","F1231204", "F123120401", "F1231205", "F123120501", "F123120502","F1231206","F123120601","F123120602","F123120603", "F1231207","F123120701", "F123120702", "F12313", "F1231301","F123130101","F123130102","F123130103", "F1231302","F123130201","F123130202", "F12314", "F1231401", "F123140101","F12315","F1231501","F123150101", "F123150102","F1231502","F123150201", "F123150202", "F123150203", "F1231503","F123150301","F123150302", "F123150303","F1231504","F123150401", "F123150402", "F123150403", "F12316","F1231601","F123160101", "F123160102","F1231602","F123160201","F123160202", "F123160203", "F123160204", "F12317", "F1231701", "F123170101","F123170102","F123170103","F12318","F1231801", "F123180101", "F1231802", "F123180201", "F123180202", "F123180203", "F1231803", "F123180301", "F123180302", "F12319", "F1231901", "F123190101", "F123190102", "F12320","F1232001","F123200101","F123200102","F123200103","F12321", "F1232101", "F123210101", "F123210102", "F12322","F1232201","F123220101","F123220102","F123220103", "F123220104", "F1232202", "F123220201", "F123220202", "F1232203","F123220301", "F1232204", "F123220401", "F123220402", "F123220403", "F1232205", "F123220501", "F123220502", "F1232206", "F123220601", "F123220602", "F1232207", "F123220701", "F1232208", "F123220801", "F123220802", "F1232209", "F123220901", "F123220902", "F1232210", "F123221001", "F12323", "F1232301", "F123230101", "F123230102", "F12324", "F1232401", "F123240101", "F12325"]

        if input_values == '0000':
            career = random.choice(seed1)

        else:
            seed1 = seed[:]
            seed1.remove(input_values)
            career = random.choice(seed1)
        return career

    # 随机选择liveAddress
    def get_liveAddress_choice(self):
        addlist = ["广东省广州市城市花园小区", "广东省佛山市城市花园小区", "广东省深圳市城市花园小区", "广东省东莞市城市花园小区", "广西省南宁市城市花园小区", "广西省柳州市城市花园小区", "广西省桂林市城市花园小区", "广西省北海市城市花园小区",	"海南省三亚市城市花园小区", "海南省海口市城市花园小区", "上海市徐汇区城市花园小区", "上海市黄浦区城市花园小区", "上海市长宁区城市花园小区", "上海市浦东新区城市花园小区", "安徽省合肥市城市花园小区", "江苏省南京市城市花园小区",	"北京市东城区城市花园小区", "北京市西城区城市花园小区", "北京市朝阳区城市花园小区", "北京市海淀区城市花园小区", "山西省太原市城市花园小区", "河北省石家庄市城市花园小区", "湖北省武汉市城市花园小区", "河南省郑州市城市花园小区", "湖南省长沙市城市花园小区"]
        city = str(random.choice(addlist))
        return city

    # 随机选择accBankName
    def get_accBankName_choice(self):
        bank_name_num_list =['0102','0103','0104','0105','0302','0303','0304','0305','0306','0308','0309','0403','0301']
        return random.choice(bank_name_num_list)

    # 随机选择accBankCard
    def get_accBankCard_choice(self, accBankName):
        bank_card = {
            '0102': 62220241000,
            '0103': 62284820320,
            '0104': 60138201000,
            '0105': 62270019350,
            '0302': 62269004,
            '0303': 62266388,
            '0304': 62263088,
            '0305': 47206800,
            '0306': 62256821210,
            '0308': 95555002,
            '0309': 6229083285,
            '0403': 62215161700,
            '0301': 62226209101,
        }
        return str(bank_card[accBankName]) + ''.join([str(i) for i in random.sample(list(range(0, 9)), 8)])

    # 随机选择accBankBranch
    def get_accBankBranch_choice(self, accBankName):
        bank_branch = {
            '0102': '工行',
            '0103': '中国农业银行',
            '0104': '中国银行',
            '0105': '中国建设银行',
            '0301': '北京分行',
            '0302': '中信实业银行',
            '0303': '中国光大银行',
            '0304': '华夏银行',
            '0305': '中国民生银行',
            '0306': '广东发展银行',
            '0308': '招商银行',
            '0309': '兴业银行',
            '0403': '中国邮政',
        }
        return bank_branch[accBankName]

    # 随机选择accProvince
    def get_accProvince_choice(self):
        list = ['河北省', '山西省', '河南省', '湖北省', '湖南省', '江苏省', '广东省', '四川省', '贵州省', '北京市', '上海市', '重庆市', '天津市']
        accProvince = random.choice(list)
        return accProvince

    # 当input_info为'0000'时，随机选择accCity
    # 当input_info为指定值时，返回输入的指定值
    def get_accCity_choice(self, input_info):
        if input_info == '0000':
            city_list = ["1000", "1100", "1210", "1240", "1243", "1244", "1245", "1246", "1247", "1248", "1249", "1251", "1260", "1261", "1262", "1263", "1264", "1270", "1271", "1281", "1282", "1283", "1284", "1285", "1286", "1287", "1288", "1289", "1291", "1292", "1293", "1294", "1295", "1310", "1311", "1321", "1322", "1323", "1324", "1325", "1326", "1327", "1328", "1329", "1331", "1332", "1333", "1334", "1335", "1336", "1337", "1340", "1341", "1342", "1351", "1352", "1353", "1354", "1355", "1356", "1357", "1358", "1359", "1361", "1362", "1363", "1364", "1365", "1366", "1367", "1368", "1369", "1371", "1372", "1380", "1381", "1391", "1392", "1393", "1394", "1395", "1396", "1397", "1398", "1399", "1401", "1402", "1403", "1410", "1411", "1421", "1422", "1423", "1424", "1425", "1426", "1427", "1430", "1431", "1432", "1441", "1442", "1443", "1444", "1445", "1446", "1447", "1448", "1449", "1451", "1452", "1453", "1460", "1461", "1462", "1463", "1464", "1465", "1466", "1467", "1468", "1480", "1482", "1483", "1484", "1485", "1486", "1487", "1488", "1489", "1491", "1492", "1610", "1620", "1630", "1631", "1632", "1633", "1634", "1635", "1637", "1638", "1639", "1640", "1641", "1651", "1652", "1661", "1662", "1663", "1664", "1665", "1666", "1667", "1668", "1669", "1671", "1672", "1680", "1681", "1682", "1683", "1684", "1690", "1691", "1710", "1712", "1713", "1714", "1715", "1716", "1717", "1718", "1719", "1721", "1722", "1723", "1724", "1725", "1730", "1731", "1732", "1733", "1734", "1735", "1736", "1737", "1738", "1739", "1741", "1743", "1744", "1750", "1752", "1753", "1754", "1755", "1756", "1757", "1758", "1759", "1761", "1762", "1770", "1772", "1773", "1774", "1775", "1776", "1777", "1778", "1779", "1781", "1782", "1783", "1784", "1785", "1786", "1787", "1788", "1810", "1812", "1813", "1814", "1815", "1816", "1817", "1818", "1819", "1821", "1822", "1823", "1824", "1910", "1920", "1921", "1922", "1930", "1940", "1941", "1942", "1943", "1944", "1945", "1946", "1947", "1948", "1949", "1960", "1962", "1963", "1964", "1965", "1966", "1967", "1968", "1969", "1971", "1972", "1973", "1974", "1980", "1983", "1984", "1985", "1986", "1990", "1992", "1993", "1994", "1995", "1996", "1997", "1998", "2010", "2011", "2013", "2014", "2015", "2016", "2017", "2018", "2019", "2021", "2022", "2023", "2030", "2035", "2036", "2037", "2038", "2039", "2041", "2042", "2043", "2044", "2045", "2046", "2050", "2052", "2053", "2054", "2055", "2056", "2057", "2058", "2070", "2072", "2073", "2074", "2075", "2076", "2077", "2080", "2082", "2083", "2210", "2220", "2222", "2223", "2224", "2225", "2230", "2231", "2232", "2240", "2241", "2242", "2243", "2250", "2251", "2252", "2260", "2261", "2262", "2263", "2264", "2265", "2270", "2271", "2272", "2273", "2274", "2275", "2276", "2277", "2280", "2282", "2290", "2291", "2292", "2310", "2311", "2312", "2320", "2321", "2322", "2330", "2332", "2333", "2336", "2337", "2340", "2342", "2343", "2344", "2345", "2346", "2410", "2420", "2421", "2422", "2423", "2424", "2425", "2426", "2430", "2431", "2432", "2433", "2434", "2440", "2441", "2442", "2450", "2451", "2452", "2453", "2454", "2455", "2460", "2461", "2462", "2463", "2464", "2470", "2472", "2473", "2474", "2475", "2476", "2477", "2478", "2479", "2490", "2492", "2493", "2494", "2495", "2496", "2497", "2498", "2520", "2610", "2640", "2641", "2642", "2643", "2644", "2645", "2646", "2647", "2648", "2649", "2650", "2651", "2652", "2660", "2661", "2670", "2671", "2672", "2680", "2681", "2690", "2710", "2711", "2712", "2720", "2721", "2723", "2724", "2725", "2726", "2727", "2728", "2729", "2731", "2740", "2741", "2751", "2752", "2753", "2754", "2755", "2756", "2757", "2758", "2760", "2762", "2763", "2764", "2765", "2766", "2767", "2768", "2769", "2771", "2772", "2773", "2780", "2782", "2783", "2784", "2786", "2787", "2790", "2791", "2792", "2793", "2900", "3010", "3020", "3022", "3023", "3030", "3031", "3032", "3033", "3034", "3035", "3036", "3040", "3042", "3043", "3050", "3051", "3052", "3054", "3055", "3056", "3060", "3061", "3062", "3063", "3065", "3066", "3070", "3071", "3072", "3073", "3080", "3082", "3083", "3084", "3085", "3086", "3087", "3088", "3089", "3090", "3093", "3094", "3110", "3111", "3112", "3113", "3114", "3115", "3116", "3117", "3118", "3120", "3121", "3122", "3123", "3124", "3125", "3128", "3129", "3131", "3132", "3140", "3141", "3142", "3143", "3310", "3320", "3321", "3322", "3324", "3325", "3326", "3330", "3332", "3333", "3334", "3335", "3336", "3337", "3338", "3339", "3350", "3351", "3352", "3353", "3354", "3355", "3360", "3361", "3362", "3363", "3370", "3371", "3372", "3373", "3374", "3375", "3380", "3382", "3383", "3384", "3385", "3386", "3387", "3388", "3410", "3412", "3413", "3414", "3415", "3420", "3421", "3422", "3430", "3432", "3433", "3434", "3435", "3436", "3437", "3438", "3439", "3450", "3452", "3454", "3455", "3456", "3457", "3458", "3610", "3620", "3621", "3622", "3623", "3630", "3631", "3632", "3633", "3640", "3641", "3650", "3651", "3660", "3661", "3670", "3671", "3680", "3681", "3682", "3683", "3684", "3685", "3686", "3687", "3688", "3710", "3711", "3712", "3713", "3714", "3720", "3722", "3724", "3725", "3726", "3727", "3728", "3729", "3731", "3732", "3740", "3742", "3743", "3745", "3746", "3750", "3752", "3753", "3754", "3755", "3756", "3757", "3760", "3763", "3764", "3765", "3766", "3767", "3771", "3772", "3773", "3774", "3775", "3776", "3777", "3781", "3782", "3783", "3784", "3785", "3790", "3792", "3793", "3794", "3910", "3930", "3940", "3941", "3942", "3950", "3951", "3952", "3953", "3954", "3955", "3956", "3957", "3958", "3959", "3960", "3970", "3971", "3972", "3973", "3974", "3975", "3976", "3978", "3990", "3991", "3992", "3993", "3994", "3995", "3996", "3997", "3998", "3999", "4010", "4012", "4013", "4014", "4015", "4016", "4018", "4019", "4021", "4022", "4030", "4032", "4033", "4034", "4035", "4036", "4037", "4038", "4039", "4050", "4052", "4053", "4054", "4055", "4056", "4057", "4210", "4220", "4221", "4222", "4230", "4231", "4232", "4240", "4241", "4242", "4243", "4244", "4245", "4246", "4247", "4248", "4249", "4251", "4260", "4261", "4270", "4271", "4272", "4280", "4282", "4283", "4284", "4285", "4286", "4287", "4288", "4289", "4291", "4292", "4293", "4294", "4295", "4296", "4297", "4298", "4299", "4310", "4312", "4313", "4314", "4315", "4316", "4317", "4318", "4319", "4321", "4330", "4332", "4333", "4334", "4335", "4336", "4337", "4338", "4339", "4341", "4342", "4343", "4350", "4352", "4353", "4354", "4355", "4356", "4357", "4358", "4359", "4361", "4362", "4363", "4364", "4370", "4372", "4373", "4374", "4375", "4376", "4377", "4378", "4379", "4381", "4382", "4510", "4520", "4521", "4522", "4523", "4524", "4525", "4530", "4531", "4535", "4536", "4540", "4541", "4550", "4551", "4552", "4553", "4560", "4561", "4562", "4563", "4564", "4566", "4567", "4568", "4569", "4580", "4581", "4582", "4583", "4584", "4585", "4586", "4587", "4588", "4589", "4610", "4611", "4612", "4613", "4614", "4615", "4616", "4617", "4618", "4619", "4630", "4631", "4632", "4633", "4634", "4635", "4650", "4651", "4652", "4653", "4660", "4662", "4663", "4664", "4665", "4666", "4667", "4680", "4682", "4683", "4684", "4685", "4686", "4687", "4688", "4689", "4693", "4694", "4710", "4712", "4713", "4714", "4715", "4716", "4717", "4718", "4730", "4732", "4733", "4734", "4735", "4736", "4737", "4739", "4741", "4742", "4743", "4744", "4750", "4752", "4753", "4754", "4755", "4756", "4757", "4758", "4759", "4761", "4910", "4920", "4921", "4922", "4923", "4924", "4925", "4930", "4931", "4932", "4933", "4934", "4935", "4936", "4937", "4938", "4939", "4950", "4951", "4952", "4953", "4954", "4955", "4956", "4960", "4961", "4962", "4963", "4964", "4965", "4970", "4971", "4972", "4980", "4981", "4982", "4983", "4984", "4985", "4986", "4987", "4988", "5010", "5011", "5012", "5013", "5014", "5015", "5016", "5020", "5021", "5022", "5023", "5024", "5025", "5030", "5031", "5032", "5033", "5034", "5040", "5041", "5042", "5043", "5044", "5050", "5051", "5052", "5053", "5054", "5055", "5060", "5062", "5064", "5065", "5066", "5067", "5068", "5069", "5080", "5082", "5083", "5084", "5085", "5086", "5087", "5088", "5089", "5091", "5110", "5112", "5113", "5114", "5115", "5116", "5117", "5118", "5119", "5121", "5130", "5132", "5133", "5134", "5135", "5137", "5138", "5139", "5141", "5142", "5143", "5144", "5150", "5152", "5153", "5154", "5155", "5156", "5157", "5158", "5159", "5161", "5210", "5220", "5221", "5230", "5260", "5261", "5262", "5263", "5264", "5265", "5266", "5267", "5268", "5269", "5280", "5282", "5283", "5284", "5285", "5286", "5287", "5288", "5310", "5311", "5320", "5330", "5331", "5332", "5333", "5334", "5335", "5336", "5337", "5338", "5339", "5350", "5351", "5352", "5353", "5354", "5355", "5356", "5357", "5360", "5362", "5363", "5364", "5365", "5366", "5367", "5370", "5371", "5372", "5373", "5374", "5375", "5377", "5378", "5379", "5381", "5382", "5383", "5391", "5392", "5393", "5394", "5395", "5396", "5410", "5412", "5413", "5414", "5415", "5416", "5417", "5418", "5510", "5520", "5521", "5522", "5523", "5525", "5526", "5530", "5532", "5533", "5540", "5541", "5542", "5543", "5544", "5545", "5546", "5547", "5550", "5551", "5552", "5553", "5554", "5555", "5556", "5557", "5558", "5559", "5570", "5571", "5572", "5573", "5574", "5575", "5576", "5580", "5581", "5582", "5583", "5584", "5585", "5586", "5587", "5590", "5591", "5592", "5610", "5612", "5614", "5615", "5616", "5620", "5622", "5623", "5624", "5625", "5630", "5632", "5634", "5635", "5636", "5637", "5638", "5639", "5641", "5642", "5650", "5653", "5654", "5655", "5656", "5657", "5658", "5659", "5661", "5662", "5670", "5672", "5674", "5675", "5676", "5677", "5678", "5679", "5681", "5682", "5683", "5690", "5692", "5693", "5694", "5695", "5696", "5697", "5698", "5810", "5820", "5821", "5822", "5823", "5824", "5825", "5826", "5827", "5828", "5840", "5850", "5860", "5861", "5862", "5863", "5864", "5865", "5866", "5867", "5868", "5869", "5871", "5872", "5880", "5890", "5892", "5893", "5894", "5895", "5910", "5911", "5912", "5913", "5914", "5915", "5920", "5921", "5922", "5923", "5924", "5930", "5931", "5932", "5933", "5934", "5935", "5936", "5937", "5938", "5939", "5941", "5950", "5952", "5953", "5954", "5956", "5960", "5962", "5963", "5964", "5965", "5966", "5967", "5970", "5971", "5972", "5973", "5980", "5981", "5982", "5983", "5984", "5985", "5990", "5991", "5992", "5993", "6010", "6011", "6012", "6013", "6014", "6015", "6016", "6017", "6020", "6030", "6110", "6121", "6127", "6128", "6129", "6131", "6132", "6133", "6140", "6141", "6142", "6151", "6152", "6153", "6154", "6155", "6156", "6157", "6158", "6159", "6161", "6170", "6171", "6172", "6181", "6182", "6183", "6184", "6185", "6186", "6187", "6188", "6189", "6191", "6210", "6211", "6221", "6222", "6223", "6224", "6225", "6226", "6227", "6230", "6231", "6240", "6242", "6243", "6244", "6245", "6246", "6247", "6248", "6249", "6261", "6262", "6263", "6264", "6266", "6267", "6268", "6269", "6271", "6272", "6273", "6275", "6281", "6282", "6283", "6284", "6285", "6286", "6287", "6288", "6289", "6291", "6292", "6311", "6312", "6314", "6315", "6330", "6331", "6410", "6420", "6510", "6530", "6550", "6551", "6552", "6560", "6561", "6562", "6570", "6571", "6572", "6573", "6574", "6575", "6580", "6581", "6582", "6583", "6584", "6585", "6590", "6591", "6592", "6593", "6594", "6595", "6596", "6597", "6610", "6611", "6612", "6613", "6614", "6620", "6621", "6622", "6623", "6630", "6632", "6633", "6634", "6635", "6636", "6637", "6638", "6650", "6651", "6652", "6653", "6654", "6655", "6656", "6657", "6658", "6659", "6662", "6663", "6664", "6665", "6670", "6673", "6674", "6675", "6676", "6677", "6678", "6679", "6681", "6690", "6692", "6693", "6694", "6695", "6710", "6712", "6713", "6714", "6715", "6716", "6717", "6718", "6719", "6721", "6730", "6732", "6734", "6735", "6736", "6737", "6738", "6739", "6741", "6742", "6743", "6750", "6752", "6753", "6754", "6755", "6756", "6757", "6758", "6759", "6761", "6762", "6763", "6770", "6772", "6773", "6774", "6775", "6776", "6777", "6778", "6790", "6791", "6792", "6793", "6794", "6795", "6797", "6798", "6801", "6802", "6803", "6804", "6805", "6810", "6812", "6813", "6814", "6815", "6816", "6817", "6818", "6819", "6821", "6822", "6823", "6824", "6825", "6826", "6827", "6828", "6829", "6840", "6842", "6843", "6845", "6846", "6847", "6848", "6849", "6851", "6852", "6853", "6854", "6855", "6856", "6857", "6858", "6859", "6870", "6871", "6872", "6874", "6875", "7010", "7020", "7021", "7022", "7030", "7032", "7033", "7034", "7035", "7036", "7037", "7038", "7039", "7041", "7042", "7043", "7044", "7050", "7052", "7053", "7054", "7055", "7056", "7057", "7058", "7059", "7061", "7070", "7072", "7073", "7074", "7075", "7076", "7077", "7078", "7090", "7092", "7093", "7094", "7095", "7096", "7097", "7098", "7110", "7117", "7118", "7119", "7121", "7122", "7130", "7132", "7133", "7134", "7135", "7136", "7137", "7138", "7139", "7141", "7142", "7143", "7144", "7145", "7146", "7147", "7150", "7152", "7153", "7154", "7155", "7156", "7157", "7158", "7159", "7161", "7162", "7163", "7310", "7340", "7342", "7343", "7344", "7345", "7346", "7347", "7348", "7349", "7351", "7352", "7360", "7362", "7363", "7364", "7365", "7366", "7367", "7369", "7371", "7380", "7382", "7383", "7384", "7385", "7386", "7387", "7388", "7389", "7391", "7410", "7412", "7413", "7414", "7415", "7416", "7417", "7418", "7419", "7430", "7432", "7433", "7434", "7435", "7436", "7437", "7438", "7439", "7441", "7442", "7443", "7444", "7450", "7452", "7453", "7454", "7455", "7456", "7457", "7458", "7470", "7472", "7473", "7474", "7475", "7476", "7477", "7478", "7479", "7481", "7490", "7492", "7493", "7510", "7512", "7513", "7514", "7515", "7516", "7517", "7518", "7519", "7521", "7522", "7523", "7530", "7532", "7533", "7534", "7535", "7540", "7543", "7544", "7545", "7546", "7550", "7552", "7553", "7554", "7560", "7562", "7563", "7564", "7570", "7572", "7573", "7580", "7582", "7583", "7584", "7585", "7586", "7587", "7588", "7700", "7711", "7720", "7721", "7722", "7723", "7724", "7725", "7726", "7727", "7728", "7729", "7730", "7740", "7741", "7742", "7743", "7744", "7745", "7746", "7747", "7748", "7749", "7750", "7751", "7760", "7761", "7762", "7763", "7764", "7765", "7766", "7767", "7768", "7769", "7770", "7771", "7772", "7773", "7774", "7775", "7776", "7777", "7790", "7791", "7792", "7793", "7794", "7795", "7796", "7797", "7798", "7799", "7800", "7810", "7811", "7812", "7813", "7814", "7815", "7816", "7830", "7831", "7832", "7833", "7834", "7835", "7836", "7910", "7920", "7921", "7922", "7930", "7932", "7933", "7934", "7935", "7936", "7937", "7938", "7939", "7941", "7950", "7951", "7952", "7953", "7954", "7955", "7956", "7957", "7958", "7959", "7961", "7962", "7970", "7972", "7973", "7974", "7975", "7976", "7977", "7978", "7979", "7981", "7982", "7990", "7992", "7993", "7994", "7995", "7996", "7997", "7998", "7999", "8001", "8002", "8010", "8012", "8013", "8014", "8015", "8016", "8017", "8018", "8019", "8021", "8030", "8032", "8033", "8034", "8035", "8036", "8037", "8040", "8042", "8043", "8044", "8045", "8046", "8047", "8048", "8049", "8051", "8052", "8053", "8054", "8060", "8062", "8063", "8064", "8065", "8066", "8067", "8068", "8069", "8071", "8072", "8073", "8210", "8220", "8230", "8231", "8240", "8241", "8242", "8243", "8244", "8250", "8251", "8252", "8253", "8254", "8255", "8260", "8261", "8263", "8264", "8265", "8266", "8267", "8270", "8272", "8273", "8274", "8275", "8276", "8280", "8282", "8283", "8284", "8290", "8292", "8293", "8294", "8295", "8296", "8297", "8310", "8311", "8312", "8313", "8314", "8315", "8316", "8317", "8318", "8319", "8330", "8332", "8333", "8334", "8335", "8336", "8337", "8340", "8342", "8343", "8344", "8345", "8346", "8347", "8348", "8360", "8362", "8363", "8364", "8365", "8366", "8367", "8368", "8380", "8381", "8382", "8383", "8384", "8385", "8386", "8387", "8510", "8520", "8521", "8522", "8523", "8526", "8527", "8528", "8540", "8541", "8542", "8543", "8544", "8550", "8551", "8552", "8553", "8554", "8560", "8561", "8562", "8563", "8564", "8565", "8570", "8571", "8572", "8573", "8574", "8575", "8576", "8580", "8581", "8582", "8583", "8584", "8585", "8586", "8590", "8591", "8592", "8593", "8594", "8595", "8710", "8720", "8721", "8722", "8723", "8731", "8732", "8733", "8734", "8736", "8737", "8741", "8742", "8743", "8744", "8745", "8746", "8810", "8820", "8830", "8832", "8833", "8840", "8842", "8843", "8844", "8847", "8850", "8852", "8853", "8854", "8855", "8856", "8857", "8858", "8859", "8870", "8872", "8873", "8880", "8882", "8883", "8884", "8885", "8886", "8887", "8888", "8889", "8910", "8912", "8913", "8914", "8915", "8916", "8917", "8918", "8919", "8930", "8932", "8933", "8934", "8940", "8942", "8943", "8944", "8945", "8946", "8947", "8948", "8949", "8951", "8952", "8953", "8960", "8963", "8964", "8965", "8966", "8967", "8968", "8980", "8981", "8992", "8993", "8994", "8995", "8996", "8997", "8998", "8999", "9010", "9012", "9013", "9014", "9015", "9016", "9017", "9020", "9022", "9023", "9024", "9025", "9026", "9027", "9028", "9029", "9031", "9032"]
            accCity = random.choice(city_list)
        else:
            accCity = input_info
        return accCity

    # 随机生成日期
    def get_date_string(self, start, format="%Y-%m-%d"):
        strptime, strftime = datetime.datetime.strptime, datetime.datetime.strftime
        return (strftime(strptime(start, format) + datetime.timedelta(random.randint(10,100)), format))

    # 随机选择婚姻状况
    def get_marry_choice(self):
        choice_list = ["B0501", "B0502", "B0503", "B0504", "B0505", "B0506"]
        marry = random.choice(choice_list)
        return marry

    # 随机选择性别
    def get_customerSex_choice(self):
        choice_list = ["N0201", "N0202"]
        customerSex = random.choice(choice_list)
        return customerSex

    # 随机选择贷款用途
    def get_loanPurpose_choice(self):
        choice_list = ["F1101", "F1102", "F1103", "F1104", "F1105", "F1106", "F1107", "F1108", "F1109", "F1110", "F1111", "F1112", "F1113", "F1114", "F1115", "F1117", "F1199"]
        loanPurpose = random.choice(choice_list)
        return loanPurpose

    # 生成oldAppId
    def get_oldAppId(self):
        num = 10
        base_str = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
        temp = []
        for i in range(1, int(num)):
            temp.append(random.choice(base_str))
        oldAppId = ''.join(temp)
        return oldAppId

    # 生成accBankCardBindId
    def get_accBankCardBindId(self):

        return random.randint(111111111111, 999999999999)

    # 生成accBankCardBindId
    def get_companyPhone(self):

        return random.randint(11111111, 99999999)
		
	   #新建文件夹
    def mkDir(self,path):
        a = os.path.exists(path)
        if a:
            pass
        else:
            os.makedirs(path)

    def gen_random_str(self):
#        base_str = "1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
        base_str = "1234567890"
        temp = []
        num = 10
        for i in range(1, int(num)):
            temp.append(random.choice(base_str))
        flow_id = ''.join(temp)
        return flow_id

    '''
    15位身份证号码：第7、8位为出生年份(两位数)，第9、10位为出生月份，第11、12位代表出生日期，第15位代表性别，奇数为男，偶数 为女。
    18位身份证号码：第7、8、9、10位为出生年份(四位数)，第11、第12位为出生月份，第13、14位代表出生日期，第17位代表性别，奇数为男，偶数为女。
    '''
    #获取身份证号性别
    def get_sex(self,id_no):
        if len(id_no)==18:
            sexno = id_no[16]
        if len(id_no)==15:
            sexno = id_no[14]
        if int(sexno)%2==0:
            sex = '女'
        else:
            sex = '男'
        return sex

    #获取身份证号年龄 444410198810241161
    def get_age(self,id_no):
        if len(id_no)==18:
            today = datetime.datetime.now()
            born = str(id_no[6:14])
            borntime =  datetime.datetime.strptime(born,"%Y%m%d")
            print("出生日期：    "+str(borntime))
            birthday = borntime.replace(year=today.year, day=borntime.day)
            print("生日：  "+ str(birthday))
            if birthday > today:
                age = today.year - borntime.year - 1
                return age
            else:
                age = today.year - borntime.year
                return age



#Just for test
if __name__ == '__main__':
    create = CreateData()
    # age = create.get_age("444410198810241161")
    # print(str(age))
    create.change_createtime()